package com.leo.tool.jdk.core;

public class VolatileTest extends Thread {

    private static volatile Object obj = null;

    public void run() {
        while (obj == null) {
            if (obj != null) {  // never load from dump, always running
                break;
            }
        }
    }

    public static void main(String[] args) throws Exception {
        new VolatileTest().start();
        Thread.sleep(10);
        obj = new Object();
    }

}